Component({
    data: {
        active: "/pages/index/index",
        list: [{
            value: "/pages/index/index",
            label: '首页',
            icon: 'app'
        }, {
            value: '/pages/activity/activity',
            label: '社区活动',
            icon: 'view-module'
        }, {
            value: '/pages/user/user',
            label: '个人中心',
            icon: 'user'
        }],
    },

    methods: {
        onChange(e) {
            this.setData({ active: e.detail.value });
            wx.switchTab({
                url: e.detail.value
            });
        },
        init() {
            const page = getCurrentPages().pop();
			this.setData({ active: `/${page.route}` });
		}
    },
});